SHELL = /bin/sh

INCLUDEDIR = /home/fredrik/opencl/include
LIBDIR = /home/fredrik/opencl/lib/x86

CC = g++
CFLAGS = -Wall -O2 -std=c++0x -I$(INCLUDEDIR)
COMPILE = $(CC) $(CFLAGS) -c
OBJFILES := $(patsubst %.cpp,%.o,$(subst src/,obj/,$(wildcard src/*.cpp)))
LIBS = -lGLEW -lglut -lGLU -lOpenCL

.SUFFIXES:
.SUFFIXES: .cpp .h .o

all : rigidbody

rigidbody : $(OBJFILES)
	$(CC) -L$(LIBDIR) $(LIBS) -o rigidbody $(OBJFILES)

obj/%.o : src/%.cpp src/%.h 
	$(COMPILE) -o $@ $<

tags : 
	ctags src/*.h src/*.cpp
	mv tags src/tags

clean :
	rm -f $(OBJFILES) rigidbody src/tags

run : rigidbody
	./rigidbody

.PHONY : all clean tags run
